/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'central';
  
  checkConfig(config);
  @endpoint = getEndpoint('domain', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AcceptDemandRequest {
  bizId?: string(name='BizId', description='This parameter is required.', example='SE20183A0Q7C5556'),
  message?: string(name='Message'),
}

model AcceptDemandResponseBody = {
  bindUrl?: string(name='BindUrl'),
  requestId?: string(name='RequestId', example='497F7522-82B0-4BD4-84FE-AE8749E4C2F9'),
}

model AcceptDemandResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AcceptDemandResponseBody(name='body'),
}

/**
 * @param request AcceptDemandRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AcceptDemandResponse
 */
async function acceptDemandWithOptions(request: AcceptDemandRequest, runtime: Util.RuntimeOptions): AcceptDemandResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.message)) {
    query['Message'] = request.message;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AcceptDemand',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request AcceptDemandRequest
 * @return AcceptDemandResponse
 */
async function acceptDemand(request: AcceptDemandRequest): AcceptDemandResponse {
  var runtime = new Util.RuntimeOptions{};
  return acceptDemandWithOptions(request, runtime);
}

model BidDomainRequest {
  auctionId?: string(name='AuctionId', description='This parameter is required.', example='12345678'),
  currency?: string(name='Currency', description='This parameter is required.', example='RMB'),
  maxBid?: float(name='MaxBid', description='This parameter is required.', example='100'),
}

model BidDomainResponseBody = {
  auctionId?: string(name='AuctionId', example='12345678'),
  requestId?: string(name='RequestId', example='CC615585-9D93-4179-BD16-09337E32A3A7'),
}

model BidDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BidDomainResponseBody(name='body'),
}

/**
 * @param request BidDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BidDomainResponse
 */
async function bidDomainWithOptions(request: BidDomainRequest, runtime: Util.RuntimeOptions): BidDomainResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.auctionId)) {
    body['AuctionId'] = request.auctionId;
  }
  if (!Util.isUnset(request.currency)) {
    body['Currency'] = request.currency;
  }
  if (!Util.isUnset(request.maxBid)) {
    body['MaxBid'] = request.maxBid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'BidDomain',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request BidDomainRequest
 * @return BidDomainResponse
 */
async function bidDomain(request: BidDomainRequest): BidDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return bidDomainWithOptions(request, runtime);
}

model ChangeAuctionRequest {
  auctionList?: [ 
    {
      bidRecords?: [ 
        {
          createTime?: string(name='CreateTime', description='This parameter is required.'),
          price?: float(name='Price', description='This parameter is required.'),
          userId?: string(name='UserId', description='This parameter is required.'),
        }
      ](name='BidRecords'),
      domainName?: string(name='DomainName', description='This parameter is required.'),
      endTime?: string(name='EndTime', description='This parameter is required.'),
      isReserve?: int32(name='IsReserve'),
      reservePrice?: float(name='ReservePrice'),
      reserveRange?: string(name='ReserveRange'),
      status?: string(name='Status'),
      timeLeft?: long(name='TimeLeft'),
      winner?: string(name='Winner', description='This parameter is required.'),
      winnerPrice?: float(name='WinnerPrice', description='This parameter is required.'),
    }
  ](name='AuctionList'),
}

model ChangeAuctionResponseBody = {
  requestId?: string(name='RequestId'),
}

model ChangeAuctionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeAuctionResponseBody(name='body'),
}

/**
 * @param request ChangeAuctionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeAuctionResponse
 */
async function changeAuctionWithOptions(request: ChangeAuctionRequest, runtime: Util.RuntimeOptions): ChangeAuctionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.auctionList)) {
    body['AuctionList'] = request.auctionList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ChangeAuction',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ChangeAuctionRequest
 * @return ChangeAuctionResponse
 */
async function changeAuction(request: ChangeAuctionRequest): ChangeAuctionResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeAuctionWithOptions(request, runtime);
}

model CheckDomainStatusRequest {
  domain?: string(name='Domain', description='This parameter is required.'),
}

model CheckDomainStatusResponseBody = {
  errorCode?: string(name='ErrorCode'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  module?: {
    deadDate?: long(name='DeadDate'),
    domain?: string(name='Domain'),
    endTime?: long(name='EndTime'),
    price?: float(name='Price'),
    regDate?: long(name='RegDate'),
  }(name='Module'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CheckDomainStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckDomainStatusResponseBody(name='body'),
}

/**
 * @summary 校验域名在售状态
 *
 * @param request CheckDomainStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckDomainStatusResponse
 */
async function checkDomainStatusWithOptions(request: CheckDomainStatusRequest, runtime: Util.RuntimeOptions): CheckDomainStatusResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckDomainStatus',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 校验域名在售状态
 *
 * @param request CheckDomainStatusRequest
 * @return CheckDomainStatusResponse
 */
async function checkDomainStatus(request: CheckDomainStatusRequest): CheckDomainStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkDomainStatusWithOptions(request, runtime);
}

model CheckSelectedDomainStatusRequest {
  domain?: string(name='Domain', description='This parameter is required.', example='example.com'),
}

model CheckSelectedDomainStatusResponseBody = {
  errorCode?: string(name='ErrorCode', example='OssFileNotFound'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  module?: {
    deadDate?: long(name='DeadDate', example='1567353497'),
    domain?: string(name='Domain', example='example.com'),
    endTime?: long(name='EndTime', example='1567353497'),
    premium?: boolean(name='Premium'),
    price?: double(name='Price', example='20.00'),
    regDate?: long(name='RegDate', example='1566353497'),
  }(name='Module'),
  requestId?: string(name='RequestId', example='E2598CAF-DBFE-494E-95EF-B42A33C178AA'),
  success?: boolean(name='Success', example='True'),
}

model CheckSelectedDomainStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckSelectedDomainStatusResponseBody(name='body'),
}

/**
 * @summary 一口价严选询价接口
 *
 * @param request CheckSelectedDomainStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckSelectedDomainStatusResponse
 */
async function checkSelectedDomainStatusWithOptions(request: CheckSelectedDomainStatusRequest, runtime: Util.RuntimeOptions): CheckSelectedDomainStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckSelectedDomainStatus',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 一口价严选询价接口
 *
 * @param request CheckSelectedDomainStatusRequest
 * @return CheckSelectedDomainStatusResponse
 */
async function checkSelectedDomainStatus(request: CheckSelectedDomainStatusRequest): CheckSelectedDomainStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkSelectedDomainStatusWithOptions(request, runtime);
}

model CreateFixedPriceDemandOrderRequest {
  code?: string(name='Code'),
  contactId?: string(name='ContactId'),
  domain?: string(name='Domain'),
  source?: string(name='Source'),
}

model CreateFixedPriceDemandOrderResponseBody = {
  errorCode?: string(name='ErrorCode'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  module?: {
    domain?: string(name='Domain'),
    orderNo?: string(name='OrderNo'),
    price?: long(name='Price'),
  }(name='Module'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateFixedPriceDemandOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateFixedPriceDemandOrderResponseBody(name='body'),
}

/**
 * @summary 创建一口价需求单
 *
 * @param request CreateFixedPriceDemandOrderRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateFixedPriceDemandOrderResponse
 */
async function createFixedPriceDemandOrderWithOptions(request: CreateFixedPriceDemandOrderRequest, runtime: Util.RuntimeOptions): CreateFixedPriceDemandOrderResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.code)) {
    query['Code'] = request.code;
  }
  if (!Util.isUnset(request.contactId)) {
    query['ContactId'] = request.contactId;
  }
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateFixedPriceDemandOrder',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建一口价需求单
 *
 * @param request CreateFixedPriceDemandOrderRequest
 * @return CreateFixedPriceDemandOrderResponse
 */
async function createFixedPriceDemandOrder(request: CreateFixedPriceDemandOrderRequest): CreateFixedPriceDemandOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return createFixedPriceDemandOrderWithOptions(request, runtime);
}

model CreateFixedPriceSelectedOrderRequest {
  code?: string(name='Code', example='DX123456'),
  contactId?: string(name='ContactId', description='This parameter is required.', example='11935401'),
  domainName?: string(name='DomainName', description='This parameter is required.', example='example.com'),
  expectedPrice?: double(name='ExpectedPrice', description='This parameter is required.', example='20.00'),
  source?: string(name='Source', example='partnername'),
}

model CreateFixedPriceSelectedOrderResponseBody = {
  errorCode?: string(name='ErrorCode', example='DomainNotOnSale'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  module?: {
    domain?: string(name='Domain', example='example.com'),
    domainBlockTrade?: [ string ](name='DomainBlockTrade'),
    orderNo?: string(name='OrderNo', example='31199295f2074ce895645d386cb22c36'),
    price?: long(name='Price', example='20.00'),
  }(name='Module'),
  requestId?: string(name='RequestId', example='C50E41A0-09F1-4491-8DB8-AF55BD2D0CC8'),
  success?: boolean(name='Success', example='True'),
}

model CreateFixedPriceSelectedOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateFixedPriceSelectedOrderResponseBody(name='body'),
}

/**
 * @summary 一口价严选下单购买接口，阿里云账户余额直接扣费
 *
 * @param request CreateFixedPriceSelectedOrderRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateFixedPriceSelectedOrderResponse
 */
async function createFixedPriceSelectedOrderWithOptions(request: CreateFixedPriceSelectedOrderRequest, runtime: Util.RuntimeOptions): CreateFixedPriceSelectedOrderResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.code)) {
    query['Code'] = request.code;
  }
  if (!Util.isUnset(request.contactId)) {
    query['ContactId'] = request.contactId;
  }
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.expectedPrice)) {
    query['ExpectedPrice'] = request.expectedPrice;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateFixedPriceSelectedOrder',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 一口价严选下单购买接口，阿里云账户余额直接扣费
 *
 * @param request CreateFixedPriceSelectedOrderRequest
 * @return CreateFixedPriceSelectedOrderResponse
 */
async function createFixedPriceSelectedOrder(request: CreateFixedPriceSelectedOrderRequest): CreateFixedPriceSelectedOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return createFixedPriceSelectedOrderWithOptions(request, runtime);
}

model FailDemandRequest {
  bizId?: string(name='BizId', description='This parameter is required.', example='SE20183A0Q7C5556'),
  message?: string(name='Message', example='some message'),
}

model FailDemandResponseBody = {
  requestId?: string(name='RequestId', example='497F7522-82B0-4BD4-84FE-AE8749E4C2F9'),
}

model FailDemandResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FailDemandResponseBody(name='body'),
}

/**
 * @param request FailDemandRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FailDemandResponse
 */
async function failDemandWithOptions(request: FailDemandRequest, runtime: Util.RuntimeOptions): FailDemandResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.message)) {
    query['Message'] = request.message;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'FailDemand',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request FailDemandRequest
 * @return FailDemandResponse
 */
async function failDemand(request: FailDemandRequest): FailDemandResponse {
  var runtime = new Util.RuntimeOptions{};
  return failDemandWithOptions(request, runtime);
}

model FinishDemandRequest {
  bizId?: string(name='BizId', description='This parameter is required.', example='SE20183A0Q7C5556'),
  message?: string(name='Message', example='some message'),
}

model FinishDemandResponseBody = {
  requestId?: string(name='RequestId', example='497F7522-82B0-4BD4-84FE-AE8749E4C2F9'),
}

model FinishDemandResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FinishDemandResponseBody(name='body'),
}

/**
 * @param request FinishDemandRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FinishDemandResponse
 */
async function finishDemandWithOptions(request: FinishDemandRequest, runtime: Util.RuntimeOptions): FinishDemandResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.message)) {
    query['Message'] = request.message;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'FinishDemand',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request FinishDemandRequest
 * @return FinishDemandResponse
 */
async function finishDemand(request: FinishDemandRequest): FinishDemandResponse {
  var runtime = new Util.RuntimeOptions{};
  return finishDemandWithOptions(request, runtime);
}

model GetIntlDomainDownloadUrlResponseBody = {
  allowRetry?: boolean(name='AllowRetry'),
  appName?: string(name='AppName'),
  dynamicCode?: string(name='DynamicCode'),
  dynamicMessage?: string(name='DynamicMessage'),
  errorArgs?: [ any ](name='ErrorArgs'),
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  url?: string(name='Url'),
}

model GetIntlDomainDownloadUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetIntlDomainDownloadUrlResponseBody(name='body'),
}

/**
 * @param request GetIntlDomainDownloadUrlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetIntlDomainDownloadUrlResponse
 */
async function getIntlDomainDownloadUrlWithOptions(runtime: Util.RuntimeOptions): GetIntlDomainDownloadUrlResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'GetIntlDomainDownloadUrl',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @return GetIntlDomainDownloadUrlResponse
 */
async function getIntlDomainDownloadUrl(): GetIntlDomainDownloadUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIntlDomainDownloadUrlWithOptions(runtime);
}

model GetReserveDomainUrlResponseBody = {
  requestId?: string(name='RequestId', example='D34B02AE-09AF-41C1-A6D3-951A2233EDB0'),
  url?: string(name='Url', example='http://example.com'),
}

model GetReserveDomainUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetReserveDomainUrlResponseBody(name='body'),
}

/**
 * @param request GetReserveDomainUrlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetReserveDomainUrlResponse
 */
async function getReserveDomainUrlWithOptions(runtime: Util.RuntimeOptions): GetReserveDomainUrlResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'GetReserveDomainUrl',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @return GetReserveDomainUrlResponse
 */
async function getReserveDomainUrl(): GetReserveDomainUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getReserveDomainUrlWithOptions(runtime);
}

model PurchaseIntlDomainRequest {
  auctionId?: string(name='AuctionId', description='This parameter is required.'),
  currency?: string(name='Currency', description='This parameter is required.'),
  price?: double(name='Price', description='This parameter is required.'),
}

model PurchaseIntlDomainResponseBody = {
  allowRetry?: boolean(name='AllowRetry'),
  appName?: string(name='AppName'),
  auctionId?: string(name='AuctionId'),
  dynamicCode?: string(name='DynamicCode'),
  dynamicMessage?: string(name='DynamicMessage'),
  errorArgs?: [ any ](name='ErrorArgs'),
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model PurchaseIntlDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PurchaseIntlDomainResponseBody(name='body'),
}

/**
 * @summary 购买国际站预释放域名
 *
 * @param request PurchaseIntlDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PurchaseIntlDomainResponse
 */
async function purchaseIntlDomainWithOptions(request: PurchaseIntlDomainRequest, runtime: Util.RuntimeOptions): PurchaseIntlDomainResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.auctionId)) {
    body['AuctionId'] = request.auctionId;
  }
  if (!Util.isUnset(request.currency)) {
    body['Currency'] = request.currency;
  }
  if (!Util.isUnset(request.price)) {
    body['Price'] = request.price;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'PurchaseIntlDomain',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 购买国际站预释放域名
 *
 * @param request PurchaseIntlDomainRequest
 * @return PurchaseIntlDomainResponse
 */
async function purchaseIntlDomain(request: PurchaseIntlDomainRequest): PurchaseIntlDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return purchaseIntlDomainWithOptions(request, runtime);
}

model QueryAuctionDetailRequest {
  auctionId?: string(name='AuctionId', description='This parameter is required.', example='123456'),
}

model QueryAuctionDetailResponseBody = {
  auctionEndTime?: long(name='AuctionEndTime', example='1515961936000'),
  auctionId?: string(name='AuctionId', example='123456'),
  bookEndTime?: long(name='BookEndTime', example='1515961936000'),
  bookedPartner?: string(name='BookedPartner', example='4'),
  currency?: string(name='Currency', example='RMB'),
  deliveryTime?: long(name='DeliveryTime', example='1515961936000'),
  domainName?: string(name='DomainName', example='test.com'),
  domainType?: string(name='DomainType', example='0'),
  failCode?: string(name='FailCode', example='0'),
  highBid?: float(name='HighBid', example='100'),
  highBidder?: string(name='HighBidder', example='abc'),
  nextValidBid?: float(name='NextValidBid', example='110'),
  partnerType?: string(name='PartnerType', example='4'),
  payEndTime?: long(name='PayEndTime', example='1515961936000'),
  payPrice?: float(name='PayPrice', example='200'),
  payStatus?: string(name='PayStatus', example='1'),
  produceStatus?: string(name='ProduceStatus', example='0'),
  requestId?: string(name='RequestId', example='UUID'),
  reserveMet?: boolean(name='ReserveMet', example='true'),
  reservePrice?: float(name='ReservePrice'),
  status?: string(name='Status', example='2'),
  transferInPrice?: float(name='TransferInPrice', example='50'),
  yourCurrentBid?: float(name='YourCurrentBid', example='100'),
  yourMaxBid?: float(name='YourMaxBid', example='120'),
}

model QueryAuctionDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryAuctionDetailResponseBody(name='body'),
}

/**
 * @param request QueryAuctionDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryAuctionDetailResponse
 */
async function queryAuctionDetailWithOptions(request: QueryAuctionDetailRequest, runtime: Util.RuntimeOptions): QueryAuctionDetailResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.auctionId)) {
    body['AuctionId'] = request.auctionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryAuctionDetail',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryAuctionDetailRequest
 * @return QueryAuctionDetailResponse
 */
async function queryAuctionDetail(request: QueryAuctionDetailRequest): QueryAuctionDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAuctionDetailWithOptions(request, runtime);
}

model QueryAuctionsRequest {
  auctionEndTimeOrder?: string(name='AuctionEndTimeOrder'),
  currentPage?: int32(name='CurrentPage', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  status?: string(name='Status', example='0'),
  statuses?: string(name='Statuses'),
}

model QueryAuctionsResponseBody = {
  currentPageNum?: int32(name='CurrentPageNum', example='1'),
  data?: [ 
    {
      auctionEndTime?: long(name='AuctionEndTime', example='1515961936000'),
      auctionId?: string(name='AuctionId', example='123456'),
      bookEndTime?: long(name='BookEndTime', example='1515961936000'),
      bookedPartner?: string(name='BookedPartner', example='4'),
      currency?: string(name='Currency', example='RMB'),
      deliveryTime?: long(name='DeliveryTime', example='1515961936000'),
      domainName?: string(name='DomainName', example='test.com'),
      domainType?: string(name='DomainType', example='0'),
      failCode?: string(name='FailCode', example='0'),
      highBid?: float(name='HighBid', example='100'),
      highBidder?: string(name='HighBidder', example='abc'),
      nextValidBid?: float(name='NextValidBid', example='110'),
      partnerType?: string(name='PartnerType', example='4'),
      payEndTime?: long(name='PayEndTime', example='1515961936000'),
      payPrice?: float(name='PayPrice', example='200'),
      payStatus?: string(name='PayStatus', example='1'),
      produceStatus?: string(name='ProduceStatus', example='0'),
      reserveMax?: long(name='ReserveMax'),
      reserveMet?: boolean(name='ReserveMet', example='true'),
      reserveMin?: long(name='ReserveMin'),
      reservePrice?: long(name='ReservePrice'),
      status?: string(name='Status', example='2'),
      transferInPrice?: float(name='TransferInPrice', example='50'),
      yourCurrentBid?: float(name='YourCurrentBid', example='100'),
      yourMaxBid?: float(name='YourMaxBid', example='120'),
    }
  ](name='Data'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='UUID'),
  totalItemNum?: int32(name='TotalItemNum', example='5'),
  totalPageNum?: int32(name='TotalPageNum', example='1'),
}

model QueryAuctionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryAuctionsResponseBody(name='body'),
}

/**
 * @param request QueryAuctionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryAuctionsResponse
 */
async function queryAuctionsWithOptions(request: QueryAuctionsRequest, runtime: Util.RuntimeOptions): QueryAuctionsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.auctionEndTimeOrder)) {
    body['AuctionEndTimeOrder'] = request.auctionEndTimeOrder;
  }
  if (!Util.isUnset(request.currentPage)) {
    body['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  if (!Util.isUnset(request.statuses)) {
    body['Statuses'] = request.statuses;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryAuctions',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryAuctionsRequest
 * @return QueryAuctionsResponse
 */
async function queryAuctions(request: QueryAuctionsRequest): QueryAuctionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAuctionsWithOptions(request, runtime);
}

model QueryBidRecordsRequest {
  auctionId?: string(name='AuctionId', description='This parameter is required.', example='123456'),
  currentPage?: int32(name='CurrentPage', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model QueryBidRecordsResponseBody = {
  currentPageNum?: int32(name='CurrentPageNum', example='1'),
  data?: [ 
    {
      bid?: float(name='Bid', example='50'),
      bidTime?: long(name='BidTime', example='1515961936000'),
      bidder?: string(name='Bidder', example='abc'),
      currency?: string(name='Currency', example='RMB'),
      domainName?: string(name='DomainName', example='test.com'),
    }
  ](name='Data'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='UUID'),
  totalItemNum?: int32(name='TotalItemNum', example='5'),
  totalPageNum?: int32(name='TotalPageNum', example='1'),
}

model QueryBidRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryBidRecordsResponseBody(name='body'),
}

/**
 * @param request QueryBidRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryBidRecordsResponse
 */
async function queryBidRecordsWithOptions(request: QueryBidRecordsRequest, runtime: Util.RuntimeOptions): QueryBidRecordsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.auctionId)) {
    body['AuctionId'] = request.auctionId;
  }
  if (!Util.isUnset(request.currentPage)) {
    body['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryBidRecords',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryBidRecordsRequest
 * @return QueryBidRecordsResponse
 */
async function queryBidRecords(request: QueryBidRecordsRequest): QueryBidRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryBidRecordsWithOptions(request, runtime);
}

model QueryBookingDomainInfoRequest {
  domainName?: string(name='DomainName', description='This parameter is required.', example='abc.com'),
}

model QueryBookingDomainInfoResponseBody = {
  auctionId?: int32(name='AuctionId', example='1234'),
  bookEndTime?: long(name='BookEndTime', example='1517985730419'),
  currency?: string(name='Currency', example='USD'),
  maxBid?: float(name='MaxBid', example='15'),
  partnerType?: string(name='PartnerType', example='4'),
  requestId?: string(name='RequestId', example='234234njhjkhkj'),
  snatchNo?: string(name='SnatchNo'),
  transferInPrice?: float(name='TransferInPrice', example='17'),
}

model QueryBookingDomainInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryBookingDomainInfoResponseBody(name='body'),
}

/**
 * @param request QueryBookingDomainInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryBookingDomainInfoResponse
 */
async function queryBookingDomainInfoWithOptions(request: QueryBookingDomainInfoRequest, runtime: Util.RuntimeOptions): QueryBookingDomainInfoResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.domainName)) {
    body['DomainName'] = request.domainName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryBookingDomainInfo',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryBookingDomainInfoRequest
 * @return QueryBookingDomainInfoResponse
 */
async function queryBookingDomainInfo(request: QueryBookingDomainInfoRequest): QueryBookingDomainInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryBookingDomainInfoWithOptions(request, runtime);
}

model QueryBrokerDemandRequest {
  bizId?: string(name='BizId', example='SE20183915FI0178'),
  currentPage?: int32(name='CurrentPage', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  status?: string(name='Status', example='1'),
}

model QueryBrokerDemandResponseBody = {
  currentPageNum?: int32(name='CurrentPageNum', example='1'),
  data?: [ 
    {
      auditStatus?: int32(name='AuditStatus'),
      bargainSellerMobile?: string(name='BargainSellerMobile', example='13300000001'),
      bargainSellerPrice?: float(name='BargainSellerPrice', example='100'),
      bizId?: string(name='BizId', example='SE20183915FI0178'),
      demandDomain?: string(name='DemandDomain', example='taobao.com'),
      demandPrice?: float(name='DemandPrice', example='1'),
      description?: string(name='Description'),
      email?: string(name='Email'),
      mobile?: string(name='Mobile', example='13300000000'),
      orderType?: int32(name='OrderType'),
      partnerDomain?: string(name='PartnerDomain'),
      payDomain?: string(name='PayDomain', example='test.com'),
      payPrice?: float(name='PayPrice', example='100'),
      payTime?: long(name='PayTime', example='1524800053000'),
      produceType?: int32(name='ProduceType', example='1'),
      publishTime?: long(name='PublishTime', example='1524800053000'),
      purchaseStatus?: int32(name='PurchaseStatus'),
      servicePayPrice?: float(name='ServicePayPrice', example='18800'),
      settleBasePrice?: float(name='SettleBasePrice'),
      status?: string(name='Status', example='1'),
    }
  ](name='Data'),
  pageSize?: int32(name='PageSize', example='20'),
  requestId?: string(name='RequestId', example='497F7522-82B0-4BD4-84FE-AE8749E4C2F9'),
  totalItemNum?: int32(name='TotalItemNum', example='20'),
  totalPageNum?: int32(name='TotalPageNum', example='1'),
}

model QueryBrokerDemandResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryBrokerDemandResponseBody(name='body'),
}

/**
 * @summary 查询回购订单列表
 *
 * @param request QueryBrokerDemandRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryBrokerDemandResponse
 */
async function queryBrokerDemandWithOptions(request: QueryBrokerDemandRequest, runtime: Util.RuntimeOptions): QueryBrokerDemandResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryBrokerDemand',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询回购订单列表
 *
 * @param request QueryBrokerDemandRequest
 * @return QueryBrokerDemandResponse
 */
async function queryBrokerDemand(request: QueryBrokerDemandRequest): QueryBrokerDemandResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryBrokerDemandWithOptions(request, runtime);
}

model QueryBrokerDemandRecordRequest {
  bizId?: string(name='BizId', description='This parameter is required.', example='SE20183A0Q7C5556'),
  currentPage?: int32(name='CurrentPage', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
}

model QueryBrokerDemandRecordResponseBody = {
  currentPageNum?: int32(name='CurrentPageNum', example='1'),
  data?: {
    brokerDemandRecord?: [ 
    {
      bizId?: string(name='BizId', example='SE20183A0Q7C5556'),
      createTime?: long(name='CreateTime', example='1525249317000'),
      description?: string(name='Description'),
    }
  ](name='BrokerDemandRecord')
  }(name='Data'),
  pageSize?: int32(name='PageSize', example='20'),
  requestId?: string(name='RequestId', example='497F7522-82B0-4BD4-84FE-AE8749E4C2F9'),
  totalItemNum?: int32(name='TotalItemNum', example='20'),
  totalPageNum?: int32(name='TotalPageNum', example='1'),
}

model QueryBrokerDemandRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryBrokerDemandRecordResponseBody(name='body'),
}

/**
 * @param request QueryBrokerDemandRecordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryBrokerDemandRecordResponse
 */
async function queryBrokerDemandRecordWithOptions(request: QueryBrokerDemandRecordRequest, runtime: Util.RuntimeOptions): QueryBrokerDemandRecordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryBrokerDemandRecord',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryBrokerDemandRecordRequest
 * @return QueryBrokerDemandRecordResponse
 */
async function queryBrokerDemandRecord(request: QueryBrokerDemandRecordRequest): QueryBrokerDemandRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryBrokerDemandRecordWithOptions(request, runtime);
}

model QueryDomainTransferStatusRequest {
  domainName?: string(name='DomainName'),
}

model QueryDomainTransferStatusResponseBody = {
  domainTransferStatus?: [ 
    {
      domainName?: string(name='DomainName'),
      domainStatusDescription?: string(name='DomainStatusDescription'),
    }
  ](name='DomainTransferStatus'),
  requestId?: string(name='RequestId'),
}

model QueryDomainTransferStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDomainTransferStatusResponseBody(name='body'),
}

/**
 * @param request QueryDomainTransferStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryDomainTransferStatusResponse
 */
async function queryDomainTransferStatusWithOptions(request: QueryDomainTransferStatusRequest, runtime: Util.RuntimeOptions): QueryDomainTransferStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.domainName)) {
    body['DomainName'] = request.domainName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryDomainTransferStatus',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryDomainTransferStatusRequest
 * @return QueryDomainTransferStatusResponse
 */
async function queryDomainTransferStatus(request: QueryDomainTransferStatusRequest): QueryDomainTransferStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDomainTransferStatusWithOptions(request, runtime);
}

model QueryExchangeRateRequest {
  fromCurrency?: string(name='FromCurrency', description='This parameter is required.', example='USD'),
  toCurrency?: string(name='ToCurrency', description='This parameter is required.', example='CNY'),
}

model QueryExchangeRateResponseBody = {
  exchangeRate?: double(name='ExchangeRate', example='7.12'),
  requestId?: string(name='RequestId', example='D200000-C0B9-4CD3-B92A-9B44A000000'),
}

model QueryExchangeRateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryExchangeRateResponseBody(name='body'),
}

/**
 * @summary 查询汇率
 *
 * @param request QueryExchangeRateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryExchangeRateResponse
 */
async function queryExchangeRateWithOptions(request: QueryExchangeRateRequest, runtime: Util.RuntimeOptions): QueryExchangeRateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fromCurrency)) {
    query['FromCurrency'] = request.fromCurrency;
  }
  if (!Util.isUnset(request.toCurrency)) {
    query['ToCurrency'] = request.toCurrency;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryExchangeRate',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询汇率
 *
 * @param request QueryExchangeRateRequest
 * @return QueryExchangeRateResponse
 */
async function queryExchangeRate(request: QueryExchangeRateRequest): QueryExchangeRateResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryExchangeRateWithOptions(request, runtime);
}

model QueryPurchasedDomainsRequest {
  currentPage?: int32(name='CurrentPage'),
  domainName?: string(name='DomainName'),
  endOperationTime?: string(name='EndOperationTime'),
  opTimeOrder?: boolean(name='OpTimeOrder'),
  operationStatus?: int32(name='OperationStatus'),
  pageSize?: int32(name='PageSize'),
  productType?: int32(name='ProductType'),
  startOperationTime?: string(name='StartOperationTime'),
  updateTimeOrder?: boolean(name='UpdateTimeOrder'),
}

model QueryPurchasedDomainsResponseBody = {
  currentPageNum?: int32(name='CurrentPageNum'),
  data?: [ 
    {
      deliveryTime?: string(name='DeliveryTime'),
      domainName?: string(name='DomainName'),
      operationStatus?: string(name='OperationStatus'),
      operationTime?: string(name='OperationTime'),
      productType?: string(name='ProductType'),
      tradeMoney?: double(name='TradeMoney'),
    }
  ](name='Data'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalItemNum?: int32(name='TotalItemNum'),
  totalPageNum?: int32(name='TotalPageNum'),
}

model QueryPurchasedDomainsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryPurchasedDomainsResponseBody(name='body'),
}

/**
 * @param request QueryPurchasedDomainsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryPurchasedDomainsResponse
 */
async function queryPurchasedDomainsWithOptions(request: QueryPurchasedDomainsRequest, runtime: Util.RuntimeOptions): QueryPurchasedDomainsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.currentPage)) {
    body['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.domainName)) {
    body['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.endOperationTime)) {
    body['EndOperationTime'] = request.endOperationTime;
  }
  if (!Util.isUnset(request.opTimeOrder)) {
    body['OpTimeOrder'] = request.opTimeOrder;
  }
  if (!Util.isUnset(request.operationStatus)) {
    body['OperationStatus'] = request.operationStatus;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productType)) {
    body['ProductType'] = request.productType;
  }
  if (!Util.isUnset(request.startOperationTime)) {
    body['StartOperationTime'] = request.startOperationTime;
  }
  if (!Util.isUnset(request.updateTimeOrder)) {
    body['UpdateTimeOrder'] = request.updateTimeOrder;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryPurchasedDomains',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryPurchasedDomainsRequest
 * @return QueryPurchasedDomainsResponse
 */
async function queryPurchasedDomains(request: QueryPurchasedDomainsRequest): QueryPurchasedDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPurchasedDomainsWithOptions(request, runtime);
}

model RecordDemandRequest {
  bizId?: string(name='BizId', description='This parameter is required.', example='SE20183A0Q7C5556'),
  message?: string(name='Message', description='This parameter is required.', example='some message'),
}

model RecordDemandResponseBody = {
  requestId?: string(name='RequestId', example='497F7522-82B0-4BD4-84FE-AE8749E4C2F9'),
}

model RecordDemandResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RecordDemandResponseBody(name='body'),
}

/**
 * @param request RecordDemandRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RecordDemandResponse
 */
async function recordDemandWithOptions(request: RecordDemandRequest, runtime: Util.RuntimeOptions): RecordDemandResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.message)) {
    query['Message'] = request.message;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RecordDemand',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request RecordDemandRequest
 * @return RecordDemandResponse
 */
async function recordDemand(request: RecordDemandRequest): RecordDemandResponse {
  var runtime = new Util.RuntimeOptions{};
  return recordDemandWithOptions(request, runtime);
}

model RefuseDemandRequest {
  bizId?: string(name='BizId', description='This parameter is required.', example='SE20183A0Q7C5556'),
  message?: string(name='Message', example='some message'),
}

model RefuseDemandResponseBody = {
  requestId?: string(name='RequestId', example='497F7522-82B0-4BD4-84FE-AE8749E4C2F9'),
}

model RefuseDemandResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefuseDemandResponseBody(name='body'),
}

/**
 * @param request RefuseDemandRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RefuseDemandResponse
 */
async function refuseDemandWithOptions(request: RefuseDemandRequest, runtime: Util.RuntimeOptions): RefuseDemandResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.message)) {
    query['Message'] = request.message;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RefuseDemand',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request RefuseDemandRequest
 * @return RefuseDemandResponse
 */
async function refuseDemand(request: RefuseDemandRequest): RefuseDemandResponse {
  var runtime = new Util.RuntimeOptions{};
  return refuseDemandWithOptions(request, runtime);
}

model RequestPayDemandRequest {
  bizId?: string(name='BizId', description='This parameter is required.', example='SE20183A0Q7C5556'),
  domainName?: string(name='DomainName', description='This parameter is required.', example='test.com'),
  message?: string(name='Message', example='some message'),
  price?: float(name='Price', description='This parameter is required.', example='100'),
  produceType?: int32(name='ProduceType', example='1'),
}

model RequestPayDemandResponseBody = {
  requestId?: string(name='RequestId', example='497F7522-82B0-4BD4-84FE-AE8749E4C2F9'),
}

model RequestPayDemandResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RequestPayDemandResponseBody(name='body'),
}

/**
 * @param request RequestPayDemandRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RequestPayDemandResponse
 */
async function requestPayDemandWithOptions(request: RequestPayDemandRequest, runtime: Util.RuntimeOptions): RequestPayDemandResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.message)) {
    query['Message'] = request.message;
  }
  if (!Util.isUnset(request.price)) {
    query['Price'] = request.price;
  }
  if (!Util.isUnset(request.produceType)) {
    query['ProduceType'] = request.produceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RequestPayDemand',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request RequestPayDemandRequest
 * @return RequestPayDemandResponse
 */
async function requestPayDemand(request: RequestPayDemandRequest): RequestPayDemandResponse {
  var runtime = new Util.RuntimeOptions{};
  return requestPayDemandWithOptions(request, runtime);
}

model ReserveDomainRequest {
  channels?: [ string ](name='Channels', example='4'),
  domainName?: string(name='DomainName', description='This parameter is required.', example='aliyun.com'),
}

model ReserveDomainResponseBody = {
  auctionId?: string(name='AuctionId', example='12080761'),
  requestId?: string(name='RequestId', example='64F63E07-3AF6-4D59-8616-55DF1A9E03ED'),
}

model ReserveDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReserveDomainResponseBody(name='body'),
}

/**
 * @param request ReserveDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReserveDomainResponse
 */
async function reserveDomainWithOptions(request: ReserveDomainRequest, runtime: Util.RuntimeOptions): ReserveDomainResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.channels)) {
    body['Channels'] = request.channels;
  }
  if (!Util.isUnset(request.domainName)) {
    body['DomainName'] = request.domainName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ReserveDomain',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ReserveDomainRequest
 * @return ReserveDomainResponse
 */
async function reserveDomain(request: ReserveDomainRequest): ReserveDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return reserveDomainWithOptions(request, runtime);
}

model ReserveIntlDomainRequest {
  domainName?: string(name='DomainName', description='This parameter is required.'),
}

model ReserveIntlDomainResponseBody = {
  allowRetry?: boolean(name='AllowRetry'),
  appName?: string(name='AppName'),
  auctionId?: string(name='AuctionId'),
  dynamicCode?: string(name='DynamicCode'),
  dynamicMessage?: string(name='DynamicMessage'),
  errorArgs?: [ any ](name='ErrorArgs'),
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ReserveIntlDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReserveIntlDomainResponseBody(name='body'),
}

/**
 * @param request ReserveIntlDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReserveIntlDomainResponse
 */
async function reserveIntlDomainWithOptions(request: ReserveIntlDomainRequest, runtime: Util.RuntimeOptions): ReserveIntlDomainResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.domainName)) {
    body['DomainName'] = request.domainName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ReserveIntlDomain',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ReserveIntlDomainRequest
 * @return ReserveIntlDomainResponse
 */
async function reserveIntlDomain(request: ReserveIntlDomainRequest): ReserveIntlDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return reserveIntlDomainWithOptions(request, runtime);
}

model SelectedDomainListRequest {
  listDate?: string(name='ListDate', description='This parameter is required.', example='20231109'),
}

model SelectedDomainListResponseBody = {
  errorCode?: string(name='ErrorCode', example='OssFileNotFound'),
  module?: {
    downloadUrl?: string(name='DownloadUrl', example='http://selected-domain.oss-cn-zhangjiakou.aliyuncs.com/aliyun_selected_domain_20231109.gz?Expires=1699524493&OSSAccessKeyId=LTAI5tPMAybR4gfSEjdfAk1F&Signature=2Tpo7Eaf%2BqIop8SuMtI91m%2FAFpY%3D'),
  }(name='Module'),
  requestId?: string(name='RequestId', description='Id of the request', example='80011ABC-F573-4795-B0E8-377BFBBA3422'),
  success?: boolean(name='Success', example='True'),
}

model SelectedDomainListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SelectedDomainListResponseBody(name='body'),
}

/**
 * @summary 严选列表导出，明日凌晨2点前生成文件，导出凌晨1点前所有在售严选域名
 *
 * @param request SelectedDomainListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SelectedDomainListResponse
 */
async function selectedDomainListWithOptions(request: SelectedDomainListRequest, runtime: Util.RuntimeOptions): SelectedDomainListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.listDate)) {
    query['ListDate'] = request.listDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SelectedDomainList',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 严选列表导出，明日凌晨2点前生成文件，导出凌晨1点前所有在售严选域名
 *
 * @param request SelectedDomainListRequest
 * @return SelectedDomainListResponse
 */
async function selectedDomainList(request: SelectedDomainListRequest): SelectedDomainListResponse {
  var runtime = new Util.RuntimeOptions{};
  return selectedDomainListWithOptions(request, runtime);
}

model SubmitPurchaseInfoRequest {
  bizId?: string(name='BizId'),
  purchaseCurrency?: string(name='PurchaseCurrency'),
  purchasePrice?: double(name='PurchasePrice'),
  purchaseProofs?: [ string ](name='PurchaseProofs'),
}

model SubmitPurchaseInfoResponseBody = {
  allowRetry?: boolean(name='AllowRetry'),
  appName?: string(name='AppName'),
  dynamicCode?: string(name='DynamicCode'),
  dynamicMessage?: string(name='DynamicMessage'),
  errorArgs?: [ any ](name='ErrorArgs'),
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  module?: any(name='Module'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SubmitPurchaseInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitPurchaseInfoResponseBody(name='body'),
}

/**
 * @summary 提交采购信息
 *
 * @param request SubmitPurchaseInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitPurchaseInfoResponse
 */
async function submitPurchaseInfoWithOptions(request: SubmitPurchaseInfoRequest, runtime: Util.RuntimeOptions): SubmitPurchaseInfoResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.bizId)) {
    body['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.purchaseCurrency)) {
    body['PurchaseCurrency'] = request.purchaseCurrency;
  }
  if (!Util.isUnset(request.purchasePrice)) {
    body['PurchasePrice'] = request.purchasePrice;
  }
  if (!Util.isUnset(request.purchaseProofs)) {
    body['PurchaseProofs'] = request.purchaseProofs;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SubmitPurchaseInfo',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 提交采购信息
 *
 * @param request SubmitPurchaseInfoRequest
 * @return SubmitPurchaseInfoResponse
 */
async function submitPurchaseInfo(request: SubmitPurchaseInfoRequest): SubmitPurchaseInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitPurchaseInfoWithOptions(request, runtime);
}

model UpdatePartnerReservePriceRequest {
  biddingId?: int32(name='BiddingId', description='This parameter is required.'),
  domainName?: string(name='DomainName', description='This parameter is required.'),
  partnerType?: string(name='PartnerType', description='This parameter is required.'),
  reservePrice?: double(name='ReservePrice', description='This parameter is required.'),
}

model UpdatePartnerReservePriceResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpdatePartnerReservePriceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePartnerReservePriceResponseBody(name='body'),
}

/**
 * @summary 合作方同步报价
 *
 * @param request UpdatePartnerReservePriceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdatePartnerReservePriceResponse
 */
async function updatePartnerReservePriceWithOptions(request: UpdatePartnerReservePriceRequest, runtime: Util.RuntimeOptions): UpdatePartnerReservePriceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.biddingId)) {
    body['BiddingId'] = request.biddingId;
  }
  if (!Util.isUnset(request.domainName)) {
    body['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.partnerType)) {
    body['PartnerType'] = request.partnerType;
  }
  if (!Util.isUnset(request.reservePrice)) {
    body['ReservePrice'] = request.reservePrice;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdatePartnerReservePrice',
    version = '2018-02-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 合作方同步报价
 *
 * @param request UpdatePartnerReservePriceRequest
 * @return UpdatePartnerReservePriceResponse
 */
async function updatePartnerReservePrice(request: UpdatePartnerReservePriceRequest): UpdatePartnerReservePriceResponse {
  var runtime = new Util.RuntimeOptions{};
  return updatePartnerReservePriceWithOptions(request, runtime);
}

